package com.ourteam.system.domain;

import net.dao.IDataPopulateCallback;

import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.lang.ArrayUtils;

import java.util.HashMap;

/**
 * Template Name : DTO数据对象
 * Template Version : 1
 * Template Last Modfiy Date : Thu Jul 12 16:34:06 CST 2018
 * Auto Generate Date : 2018-07-20 12:05:05
  * Warning ! This file will be overwrite when regenerate !
  *
 */
import java.util.Map;


public class SystemModuleAccessLogBean implements java.io.Serializable {
    private static Map<String, String> mappedDaoFields = new HashMap<String, String>();

    static {
        mappedDaoFields.put("id",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.Id);

        mappedDaoFields.put("moduleId",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.ModuleId);

        mappedDaoFields.put("userId",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.UserId);

        mappedDaoFields.put("sessionId",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.SessionId);

        mappedDaoFields.put("accessTime",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.AccessTime);

        mappedDaoFields.put("status",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.Status);

        mappedDaoFields.put("remarks",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.Remarks);

        mappedDaoFields.put("domainId",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.DomainId);

        mappedDaoFields.put("domainName",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.DomainName);

        mappedDaoFields.put("moduleName",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.ModuleName);

        mappedDaoFields.put("userName",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.UserName);

        mappedDaoFields.put("loginTime",
            com.ourteam.system.dao.ISysModuleAccessLogDAO.LoginTime);
    }

    private com.ourteam.system.dao.SysModuleAccessLog sysModuleAccessLog;

    public SystemModuleAccessLogBean() {
        super();

        this.sysModuleAccessLog = new com.ourteam.system.dao.SysModuleAccessLog();
    }

    public SystemModuleAccessLogBean(
        com.ourteam.system.dao.SysModuleAccessLog sysModuleAccessLog) {
        super();

        this.sysModuleAccessLog = sysModuleAccessLog;
    }

    protected BeanMap getBeanMap() {
        return new BeanMap(sysModuleAccessLog);
    }

    public static String getMappedDAOField(String aAttrName) {
        return mappedDaoFields.get(aAttrName);
    }

    public com.ourteam.system.dao.SysModuleAccessLog convertToSysModuleAccessLog() {
        return this.sysModuleAccessLog;
    }

    public com.ourteam.system.dao.SysModuleAccessLog convertTo() {
        return this.sysModuleAccessLog;
    }

    /**
     * Get id
     *
     * @return long
     */
    public long getId() {
        return (long) this.sysModuleAccessLog.getId();
    }

    /**
     * Set id
     *
     * @parameter long
     */
    public void setId(long id) {
        this.sysModuleAccessLog.setId(id);
    }

    /**
     * Get moduleId
     *
     * @return long
     */
    public long getModuleId() {
        return (long) this.sysModuleAccessLog.getModuleId();
    }

    /**
     * Set moduleId
     *
     * @parameter long
     */
    public void setModuleId(long moduleId) {
        this.sysModuleAccessLog.setModuleId(moduleId);
    }

    /**
     * Get userId
     *
     * @return long
     */
    public long getUserId() {
        return (long) this.sysModuleAccessLog.getUserId();
    }

    /**
     * Set userId
     *
     * @parameter long
     */
    public void setUserId(long userId) {
        this.sysModuleAccessLog.setUserId(userId);
    }

    /**
     * Get sessionId
     *
     * @return String
     */
    public String getSessionId() {
        return (String) this.sysModuleAccessLog.getSessionId();
    }

    /**
     * Set sessionId
     *
     * @parameter String
     */
    public void setSessionId(String sessionId) {
        this.sysModuleAccessLog.setSessionId(sessionId);
    }

    /**
     * Get accessTime
     *
     * @return java.util.Date
     */
    public java.util.Date getAccessTime() {
        return (java.util.Date) this.sysModuleAccessLog.getAccessTime();
    }

    /**
     * Set accessTime
     *
     * @parameter java.util.Date
     */
    public void setAccessTime(java.util.Date accessTime) {
        this.sysModuleAccessLog.setAccessTime(accessTime);
    }

    /**
     * Get status
     *
     * @return String
     */
    public String getStatus() {
        return (String) this.sysModuleAccessLog.getStatus();
    }

    /**
     * Set status
     *
     * @parameter String
     */
    public void setStatus(String status) {
        this.sysModuleAccessLog.setStatus(status);
    }

    /**
     * Get remarks
     *
     * @return String
     */
    public String getRemarks() {
        return (String) this.sysModuleAccessLog.getRemarks();
    }

    /**
     * Set remarks
     *
     * @parameter String
     */
    public void setRemarks(String remarks) {
        this.sysModuleAccessLog.setRemarks(remarks);
    }

    /**
     * Get domainId
     *
     * @return long
     */
    public long getDomainId() {
        return (long) this.sysModuleAccessLog.getDomainId();
    }

    /**
     * Get domainName
     *
     * @return String
     */
    public String getDomainName() {
        return (String) this.sysModuleAccessLog.getDomainName();
    }

    /**
     * Get moduleName
     *
     * @return String
     */
    public String getModuleName() {
        return (String) this.sysModuleAccessLog.getModuleName();
    }

    /**
     * Get userName
     *
     * @return String
     */
    public String getUserName() {
        return (String) this.sysModuleAccessLog.getUserName();
    }

    /**
     * Get loginTime
     *
     * @return java.util.Date
     */
    public java.util.Date getLoginTime() {
        return (java.util.Date) this.sysModuleAccessLog.getLoginTime();
    }

    public int hashCode() {
        return org.apache.commons.lang.builder.HashCodeBuilder.reflectionHashCode(this);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        } // end if

        if ((obj instanceof SystemModuleAccessLogBean) == false) {
            return false;
        } // end if

        SystemModuleAccessLogBean other = (SystemModuleAccessLogBean) obj;

        boolean isEqual = false;

        com.ourteam.system.dao.SysModuleAccessLog tempSysModuleAccessLog = other.convertToSysModuleAccessLog();

        if ((tempSysModuleAccessLog == null) ||
                (this.sysModuleAccessLog == null)) {
            isEqual = false;
        } else if ((tempSysModuleAccessLog == this.sysModuleAccessLog) ||
                tempSysModuleAccessLog.equals(this.sysModuleAccessLog)) {
            isEqual = true;
        } else {
            isEqual = false;
        }

        return isEqual;
    }

    public static SystemModuleAccessLogBean[] toArray(
        com.ourteam.system.dao.SysModuleAccessLog[] aSysModuleAccessLogs) {
        return toArray(aSysModuleAccessLogs, null);
    }

    public static SystemModuleAccessLogBean[] toArray(
        com.ourteam.system.dao.SysModuleAccessLog[] aSysModuleAccessLogs,
        IDataPopulateCallback aCallBack) {
        if (ArrayUtils.isEmpty(aSysModuleAccessLogs)) {
            return new SystemModuleAccessLogBean[0];
        }

        int length = aSysModuleAccessLogs.length;

        SystemModuleAccessLogBean[] beans = new SystemModuleAccessLogBean[length];

        for (int i = 0; i < length; i++) {
            beans[i] = new SystemModuleAccessLogBean(aSysModuleAccessLogs[i]);

            if (aCallBack != null) {
                aCallBack.populate(beans[i],
                    new Object[] { aSysModuleAccessLogs[i] });
            }
        }

        return beans;
    }
}
